#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/3/2 10:17
# @Author  : 1823218990@qq.com
# @File    : vclog
# @Software: Pycharm


import os
import logging.handlers
import logging


log_path = "/opt/log/videocut"
os.makedirs(log_path, exist_ok=True)

fmt = logging.Formatter('[%(levelname)s]%(asctime)s %(filename)10s[%(lineno)s]- %(message)s')

console_handler = logging.StreamHandler()
console_handler.setFormatter(fmt)
# console_logger = logging.getLogger("console")
# console_logger.addHandler(console_handler)
#  sever
logger = logging.getLogger("videocut")
logger.setLevel(logging.DEBUG)
file_handler = logging.handlers.RotatingFileHandler(os.path.join(log_path, "videocut.log"), maxBytes=524288000)
file_handler.setFormatter(fmt)
logger.addHandler(file_handler)
logger.addHandler(console_handler)
